package com.mall.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mall.db.domain.OperationLog;
import com.mall.db.service.OperationLogService;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wxd
 * @since 2021-09-18
 */
@Controller
@RequestMapping("/system/olc")
public class OperationLogController  extends BaseController<OperationLog>{

    @Resource(name = "operationLogService")
    private OperationLogService ols;

    @Override
    public Map<String, Object> find(OperationLog ol) {

        PageHelper.startPage(ol.getPage(),ol.getLimit());

        QueryWrapper<OperationLog> qw = new QueryWrapper<>();
        List<OperationLog> list = ols.list(qw);

        PageInfo<OperationLog> page = new PageInfo<>(list,ol.getLimit());

        return this.findMap(page.getList(),page.getTotal());
    }
}

